/* AI写作助手样式 */
.ai-writer-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #467B96;
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.3s;
}

.ai-writer-btn:hover {
    background: #3c6a82;
}

.ai-writer-btn svg {
    margin-right: 6px;
}

/* 弹窗动画 */
@keyframes dialogShow {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes overlayShow {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 遮罩层 */
.ai-writer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ai-writer-overlay.show {
    opacity: 1;
    animation: overlayShow 0.2s ease forwards;
}

/* 对话框样式 */
.ai-writer-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 680px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
}

.ai-writer-dialog.show {
    animation: dialogShow 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dialog-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dialog-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 22px;
    transition: all 0.2s;
}

.dialog-close:hover {
    background: #f5f5f5;
    color: #333;
}

.dialog-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 写作选项按钮组 */
.writing-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.writing-options .ai-writer-btn {
    flex: 1;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
    transition: all 0.2s;
}

/* 输入区域 */
.chat-input {
    margin: 20px 0;
    display: flex;
    gap: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.chat-input.show {
    opacity: 1;
    transform: translateY(0);
}

.chat-input textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    min-height: 48px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.chat-input textarea:focus {
    outline: none;
    border-color: #467B96;
}

/* 生成内容区域 */
.generated-content {
    margin-top: 20px;
}

.message-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 12px;
}

/* 插入按钮样式 */
.generated-content .ai-writer-btn {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    padding: 10px;
    background: #f8f9fa;
    color: #467B96;
    border: 1px solid #467B96;
    transition: all 0.2s;
}

.generated-content .ai-writer-btn:hover {
    background: #467B96;
    color: white;
}

/* 加载动画 */
@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.generating {
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.generating::after {
    content: '...';
    animation: pulse 1.5s infinite;
}